const alert_success = "success";
const alert_info = "info";
const alert_warning = "warning";
const alert_danger = "danger";

function globalAlert(type, msg) {
    // 设置全局提示框
    let html = "";
    if (type === "success") {
        html = '<span class="glyphicon glyphicon-ok-sign">' + msg + '</span>'
        $("#alert-success").html(html);
        $("#alert-success").slideDown();
        $("#alert-success").delay(3000);
        $("#alert-success").slideUp();

    } else if (type === "info") {
        html = '<span class="glyphicon glyphicon-info-sign">' + msg + '</span>'
        $("#alert-info").html(html);
        $("#alert-info").slideDown();
        $("#alert-info").delay(3000);
        $("#alert-info").slideUp();

    } else if (type === "warning") {
        html = '<span class="glyphicon glyphicon-exclamation-sign">' + msg + '</span>'
        $("#alert-warning").html(html);
        $("#alert-warning").slideDown();
        $("#alert-warning").delay(3000);
        $("#alert-warning").slideUp();

    } else if (type === "danger") {
        html = '<span class="glyphicon glyphicon-remove-sign">' + msg + '</span>'
        $("#alert-danger").html(html);
        $("#alert-danger").slideDown();
        $("#alert-danger").delay(3000);
        $("#alert-danger").slideUp();

    } else {
        html = '<span class="glyphicon glyphicon-remove-sign"></span>输入提示类型错误!'
        $("#alert-danger").html(html);
        $("#alert-danger").slideDown();
        $("#alert-danger").delay(3000);
        $("#alert-danger").slideUp();

    }
}